var NHCustom = function() {


    return {
        //main function to initiate the theme
        init: function() {

            //Search Box
            if (Metronic.isRTL()) {
                $('#hearder_search_box').attr("dir", "rtl");
            }

            $('#hearder_search_box').typeahead({
                minLength: 3
            }, {
                displayKey: 'name',
                hint: (Metronic.isRTL() ? false : true),
                source: function(query, process) {
                    return $.post($('#hearder_search_box').attr('data-href'), {searchKey: query}, function(data) {
                        return process(data);
                    });
                },
                templates: {
                    suggestion: Handlebars.compile('<a href="{{data-href}}">{{name}}</a>')
                }
            });

            //Log out
            $('.btn-logout').click(function(event) {
                $.get( fileSystemURL ); //Logout File System
                window.location = $(this).attr('data-href');
            });            
        },
    };

}();